# map函数的使用
def bar(x):
    return x*2
print(list(map(bar,range(5))))

# reduce函数使用
from functools import reduce
def add(x,y):
    return x + y
print(reduce(add,[1,2,3]))

# filter函数
def isOdd(x):
    return x%2 == 0
print(list(filter(isOdd,[1,2,3])))